cardano-node: remove iohk-monitoring tracing backend#6580
Conversation
|
The change in [Byron.hs:122] is: Before: instance ToJSON (TxId (GenTx ByronBlock)) where ( "txid" .= (Text.take 8 . renderTxId $ txId tx) ) |
Addresses all review comments from PR #6580 (mgmeier). The root cause of most issues was that `Cardano.Tracing.HasIssuer` was incorrectly deleted as part of the iohk-monitoring cleanup
bbeb171 to
54b60dd
Compare
config parsing Replace locally-defined orphan `ToJSON`/`FromJSON` instances that already exist in `Cardano.Network.OrphanInstances` (from the `cardano-diffusion:orphan-instances` sublibrary) with imports of that module: - `TopologyP2P`: remove `FromJSON/ToJSON PeerTrustable`, `FromJSON/ToJSON (NetworkTopology UseBootstrapPeers PeerTrustable)`, and `FromJSON UseBootstrapPeers`; add `Cardano.Network.OrphanInstances ()` and `Ouroboros.Network.OrphanInstances ()` imports. - `StateRep`: remove local `ToJSON/FromJSON NodeToNodeVersion`, `ToJSON/FromJSON NodeToClientVersion`, and `parseBoundedEnum`; add `Cardano.Network.OrphanInstances ()` import. - `Tracers`: remove Show-based `ToJSON NodeToNodeVersionData` and `ToJSON NodeToClientVersionData` stubs; add `Cardano.Network.OrphanInstances ()` import. Additionally fix two pre-existing issues in `Consensus.hs`: - `deltaq`: use `toJSON gsv` (structured JSON via `Ouroboros.Network.OrphanInstances`) instead of `String . show`. - `TraceDecisionEvent`: restore the `dtal >= DMaximum` conditional branch (replacing the reversed fold), using `forMachine DMaximum` for the verbose case. In `Startup.hs`, fix `ConsensusNetworkVersionTuple` to emit proper structured JSON for `nodeToClientVersion`/`nodeToNodeVersion` via `ToJSON` from `Cardano.Network.OrphanInstances`, and fix the `maxNodeToNode/ClientVersion` field to show only the version key rather than the full `(key, value)` pair.
54b60dd to
606f5bb
Compare
606f5bb to
ed26482
Compare
| , ("TestDijkstraHardForkAtEpoch", Aeson.Number 0) | ||
| ] | ||
| ) | ||
| -- | Various tracers we can turn on or off |
There was a problem hiding this comment.
How does one configure tracing now? What are the defaults?
For example, I was using snippet below to enable PrometheusSimple endpoint - how do I do it now?
The trace-dispatcher backend has its own equivalents for severity filtering
and output routing, configured under TraceOptions in the trace-dispatcher
config file. Refer to the trace-dispatcher documentation for the current config
format.
Few more words how to configure tracing now w/ links would be greatly appreciated.
Summary
Removes the legacy
iohk-monitoring-based tracing infrastructure fromcardano-node, leavingtrace-dispatcheras the sole tracing backend.trace-dispatcherhas been the production default since node 8.x. The oldiohk-monitoringpath was retained during a transition period but is no longerused or tested in production deployments. Removing it eliminates ~11 000 lines
of dead code and 9 transitive build dependencies.
What changed
Deleted (~8 100 lines, 15 modules):
Cardano.Tracing.*—Config,HasIssuer,Metrics,Render,Shutdown,Startup,Tracers, and allOrphanInstances.*modules(Byron, Common, Consensus, HardFork, Network, Shelley)
Cardano.Node.Configuration.Logging— the iohk-monitoring init layerCardano.Node.Tracing.Compat— compatibility shimModified:
Cardano.Node.Run— simplified to use onlyinitTraceDispatcher; alllegacy
createLoggingLayer/setupTrace/Cardano.BM.*imports goneCardano.Node.TraceConstraints— removesHasIssuer,ToObject, andrelated iohk-monitoring constraints
cardano-node.cabal— dropsiohk-monitoring,lobemo-backend-*,lobemo-scribe-systemd,ekg-wai,tracer-transformers,scientific"tracing_backend"updated to"trace-dispatcher"Breaking change
Any node config still using
"UseTraceDispatcher": falseor legacyLoggingconfig keys will need to be migrated totrace-dispatcherconfiguration before upgrading. Refer to the trace-dispatcher migration guide.
Config options removed with iohk-monitoring
The following node configuration keys have no effect after the removal of the
iohk-monitoringtracing backend. All tracing is now handled exclusively bytrace-dispatcher.Parsed by the node but silently ignored
These three keys are still accepted by the JSON parser to avoid hard failures
on existing configs, but have no effect:
TurnOnLoggingTurnOnLogMetricsUseTraceDispatcherfalse) and trace-dispatcher (true) backendParsed by
Cardano.Tracing.Config(module deleted)TracingVerbosityMinimalVerbosity/NormalVerbosity/MaximalVerbosityTraceAcceptPolicyTraceBackingStoreTraceBlockFetchClientTraceBlockFetchDecisionsTraceBlockFetchProtocolTraceBlockFetchProtocolSerialisedTraceBlockFetchServerTraceBlockchainTimeTraceChainDB/TraceChainDbTraceChainSyncClientTraceChainSyncBlockServerTraceChainSyncHeaderServerTraceChainSyncProtocolTraceChurnModeTraceConnectionManagerTraceConnectionManagerCountersTraceConnectionManagerTransitionsTraceCsjTraceDevotedBlockFetchTraceDiffusionInitializationTraceDNS/TraceDnsResolver/TraceDnsSubscriptionTraceErrorPolicy/TraceLocalErrorPolicyTraceForge/TraceForgeStateInfoTraceGDDTraceGsmTraceHandshake/TraceLocalHandshakeTraceInboundGovernorTraceInboundGovernorCountersTraceInboundGovernorTransitionsTraceIpSubscriptionTraceKeepAliveClient/TraceKeepAliveProtocolTraceKesAgentTraceLedgerPeersTraceLocalChainSyncProtocolTraceLocalConnectionManagerTraceLocalMux/TraceLocalMuxBearer/TraceLocalMuxChannelTraceLocalRootPeersTraceLocalServerTraceLocalStateQueryProtocolTraceLocalTxMonitorProtocolTraceLocalTxSubmissionProtocol/TraceLocalTxSubmissionServerTraceMempoolTraceMux/TraceMuxBearer/TraceMuxChannelTracePeerSelection/TracePeerSelectionActions/TracePeerSelectionCountersTracePeerSharingProtocolTracePublicRootPeersTraceSanityCheckIssueTraceServerTraceTxCountersTraceTxInbound/TraceTxOutboundTraceTxLogicTraceTxSubmissionProtocol/TraceTxSubmission2ProtocolRead directly by the
iohk-monitoringlibraryThese keys were consumed by
Cardano.BM.Configuration— the node never parsedthem itself. They are now entirely ignored:
minSeverityDebug/Info/Notice/Warning/Error/Critical)rotationrpLogLimitBytes,rpKeepFilesNum,rpMaxAgeHours)setupBackendsKatipBK,EKGViewBK, etc.)defaultBackendssetupScribesdefaultScribeshasEKGhasPrometheusoptions.mapBackendsoptions.mapSubtraceoptions.mapSeverityReplacements in trace-dispatcher
The
trace-dispatcherbackend has its own equivalents for severity filteringand output routing, configured under
TraceOptionsin the trace-dispatcherconfig file. Refer to the trace-dispatcher documentation for the current config
format.